<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <!-- 
        把用户填写的账号和密码解析出来显示到div
     -->
     <div>
         
     </div>

     <script>
         /* 
            1.获取到用户输入的账号和密码
            ?:左边是服务器地址
            ?:右边是用户输入的参数信息
                参数就是 标签的name属性和value属性组成的
            file:///D:/java_vev/web/workepace/front-end/02-javaScript/day10/13.login_action.html?username=%E5%BC%A0%E4%B8%89&password=123
          */

          console.log(location.search)      // ?aaa=zhangsan&bbb=12345
          const divObj = document.querySelector("div")
          const values = location.search.split("&")
          console.log(values[0].split('=')[1])  //获取=右边的值
          console.log(values[1].split('=')[1])
          divObj.innerHTML='账号'+values[0].split('=')[1]+'密码'+values[1].split('=')[1]


          console.log("------------")
          console.log(values[0].split("=")[0])
          console.log(values[0].split("=")[1])
     </script>
</body>
</html>